package myutils
{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFormat;

	public class MyButtonSprite extends Sprite
	{
		public var textfield:TextField;
		
		public function MyButtonSprite(bgColor:Number,width:int,height:int,text:String,pro:Number,textcolor:Number)
		{
			graphics.lineStyle(1,0x000000,0.8)
			graphics.beginFill(bgColor,0.8);
			graphics.drawRoundRect(0,0,width,height,8);
			graphics.endFill();
			
			textfield = new TextField();
			textfield.width = width;
			textfield.height = height;
			var format:TextFormat = new TextFormat();
			format.font = "Verdana";
			format.color = textcolor;
			format.size = height * pro;
			textfield.defaultTextFormat = format;
			textfield.text = text;
			addChild(textfield);
		}
	}
}